public class Test {
    public static void main(String[] args) {
        int a = 2;
        int b = 4;

        System.out.println((int)Math.pow(a, b));

    }
}


/*
class Solution {
    public int getDecimalValue(ListNode head) {
        int sum = 0;
        if(head == null) {
            return 0 ;
        }
        int count = 0;
        ListNode cur = head;
        while(cur != null) {
            count++;
            cur = cur.next;
        }
        while(head !=  null) {
            if(head.val == 0) {
                sum += (int)Math.pow(2,count-1) * 0;
                count--;
            }
            else {
                sum += (int)Math.pow(2,count-1) * 1;
                count--;
            }
            head = head.next;
        }
        return sum;
    }
}
 */

/*
反转链表
class Solution {
    public ListNode reverseList(ListNode head) {
        if(head == null) {
            return null;
        }
        ListNode cur = head.next;
        head.next = null;
        while(cur != null) {
            ListNode curNext = cur.next;
            cur.next =head;
            head = cur;
            cur = curNext;
        }
        return head;

    }
}
 */
/*
倒数节点
class Solution {
    public int kthToLast(ListNode head, int k) {
        ListNode fast = head;
        ListNode slow = head;
        while( k != 0) {
            fast = fast.next;
            k--;
        }
        while( fast != null) {
            fast = fast.next;
            slow = slow.next;
        }
        return slow.val;


    }
}
 */
/*
class Solution {
    public ListNode middleNode(ListNode head) {
        if(head == null) {
            return null;
        }
        ListNode fast = head;
        ListNode slow = head;
        while( fast != null && fast.next != null) {
            slow = slow.next;
            fast = fast.next.next;
        }
        return slow;
    }
}
 */